package com.sixks.app.domain.sku;

import java.util.*;

/**
 * @author colin
 * @date: 16/03/2014
 * @time: 18:46
 */
public class ProductHistory {
    /**
     * 存放日期，及对应的Product信息
     */
    private Map<Date,Product> histories = new TreeMap<Date, Product>(new Comparator<Date>() {
        @Override
        public int compare(Date o1, Date o2) {
            return o1.compareTo(o2);
        }
    });

    public void add(Date date, Product product){
        histories.put(date, product);
    }
    public Product get(Date date){
        return histories.get(date);
    }

    public Map<Date, Product> getHistories() {
        return histories;
    }

    public void setHistories(Map<Date, Product> histories) {
        this.histories = histories;
    }

    public boolean contains(Date create) {
        return histories.containsKey(create);
    }
}
